#ifndef STRUCTURES_HPP
#define STRUCTURES_HPP

#include <vector>
#include <string>
#include <memory>

// 点结构
struct Point {
    double x;
    double y;
};

// 点要素结构
struct PointFeature {
    int id;
    Point coord;
};

// 线要素结构
struct PolylineFeature {
    int id;
    std::vector<int> pointIndices;  // 使用vector替代动态数组
};

// 面要素结构
struct PolygonFeature {
    int id;
    std::vector<int> pointIndices;  // 使用vector替代动态数组
    double area;
};

// 数据集结构
class Dataset {
public:
    std::vector<PointFeature> points;
    std::vector<PolylineFeature> polylines;
    std::vector<PolygonFeature> polygons;
    std::vector<Point> allPoints;

    // 添加便捷方法
    int addPoint(const Point& point) {
        allPoints.push_back(point);
        return allPoints.size() - 1;
    }
};

#endif 